#438.找到字符串中所有字母异位词
from typing import List
class Solution:
    def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
        from collections import defaultdict
        l=defaultdict(list)

        for i in strs:
            k="".join(sorted(i))
            l[k].append(i)

        return list(l.values())